<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('资料文件夹管理者分配')" />
</head>
<body>
<div style="padding: 0 10px;"><table class="layui-hide" id="dhtable" lay-filter="ftable"></table></div>
<th:block th:include="include :: footer" />
<script>
    layui.use(['table','layer','jquery'], function () {
        var $ = layui.$,layer = layui.layer,table = layui.table,form = layui.form;
        $.tablelist.init({
            elem: '#dhtable'
            ,url: "/system/user/list?moduleTable=TS_organizationinfo"
            ,cols: [[
                {type:'numbers', fixed: 'left'}
                ,{type: 'checkbox'}
                ,{field:'userId', title: '编号',align: 'center',width: 80, event: 'setSign'}
                ,{field:'userName', title: '名称',align: 'center',width: 120}
                ,{field:'deptName', title: '部门名称',align: 'center',width: 180}
                ,{field:'deptPathName', title: '部门全路径名称',align: 'center',width: 380}
                ,{field:'cidName', title: '公司名称',align: 'center',width: 220}
            ]
            ]
            ,height:320
            ,width:680
        });
		//点击table行选中复选框
		$(document).on("click",".layui-table-body table.layui-table tbody tr",function(){
	        var obj = event ? event.target : event.srcElement;
	        var tag = obj.tagName;
	        var checkbox = $(this).find("td div.laytable-cell-checkbox div.layui-form-checkbox I");
	        if(checkbox.length!=0){
	            if(tag == 'DIV') {
	                checkbox.click();
	            }
	        }
	    });
		//点击复选框阻止冒泡
	    $(document).on("click",".layui-form-checkbox",function(e){
	        e.stopPropagation();
	        var data = [], data2 = [];
	        var checkStatus = table.checkStatus('dhtable');
	           data = checkStatus.data;
	        if(data.length > 0){$(".addbtn").removeClass("layui-btn-disabled");$(".addbtn").children().css('color','#fff');}else{$(".addbtn").addClass("layui-btn-disabled");$(".addbtn").children().css('color','#C9C9C9');}
	        var checkStatus2 = table.checkStatus('dhtable2');
	           data2 = checkStatus2.data;
	        if(data2.length > 0){$(".delbtn").removeClass("layui-btn-disabled");$(".delbtn").children().css('color','#fff');}else{$(".delbtn").addClass("layui-btn-disabled");$(".delbtn").children().css('color','#C9C9C9');}
	    });
    });
    var callbackdata = function () {
        var checkStatus = table.checkStatus('dhtable')
            ,data = checkStatus.data;
        return data;
    }
</script>
</body>
</html>